styleproperty: Add _gtk_style_property_is_inherit()
authorBenjamin Otte <otte@redhat.com>
Tue, 31 May 2011 10:05:43 +0000 (12:05 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 Jun 2011 00:03:52 +0000 (02:03 +0200)
And use it instead of gtk_style_param_get_inherit()

gtk/gtkcssprovider.c
gtk/gtkstyleproperty.c
gtk/gtkstylepropertyprivate.h

index 32e9b87dc170326b43a8e0c83cb0a50c63298cbe..e3ca238783115456f60fd7d4922b1d8b80d89f30 100644 (file)
@@ -1126,7 +1126,7 @@ gtk_css_ruleset_add (GtkCssRuleset          *ruleset,
       return;
     }
 
-  ruleset->has_inherit |= gtk_style_param_get_inherit (prop->pspec);
+  ruleset->has_inherit |= _gtk_style_property_is_inherit (prop);
   g_hash_table_insert (ruleset->style, (gpointer) prop, value);
 }
 
@@ -1327,7 +1327,7 @@ gtk_css_provider_get_style (GtkStyleProvider *provider,
             {
               GtkStyleProperty *prop = key;
 
-              if (l != length && !gtk_style_param_get_inherit (prop->pspec))
+              if (l != length && !_gtk_style_property_is_inherit (prop))
                 continue;
 
               _gtk_style_properties_set_property_by_property (props,
index efb978596aad65da54a23208822d2284c50e2bbe..a6bf2345633ce3f6884477781a5175d74908d2fa 100644 (file)
@@ -1941,6 +1941,14 @@ _gtk_style_property_default_value (const GtkStyleProperty *property,
     g_param_value_set_default (property->pspec, value);
 }
 
+gboolean
+_gtk_style_property_is_inherit (const GtkStyleProperty *property)
+{
+  g_return_val_if_fail (property != NULL, FALSE);
+
+  return gtk_style_param_get_inherit (property->pspec);
+}
+
 gboolean
 _gtk_style_property_is_shorthand  (const GtkStyleProperty *property)
 {
index 30aa62f2bb152a33acd4a0a5df0ea68422a50bf1..7ee23f80f0ca46e02080e350e53f99a56f385c41 100644 (file)
@@ -61,6 +61,8 @@ void                     _gtk_style_property_register      (GParamSpec
                                                             GtkStylePrintFunc       print_func,
                                                             GtkStyleDefaultValueFunc default_value_func);
 
+gboolean                 _gtk_style_property_is_inherit    (const GtkStyleProperty *property);
+
 void                     _gtk_style_property_default_value (const GtkStyleProperty *property,
                                                             GtkStyleProperties     *properties,
                                                             GValue                 *value);